package com.example.taobaounion.utils

import android.content.pm.PackageManager
import com.example.taobaounion.app.App

/**
 *@author : Administrator
 *@descreption : 检查手机是否安装某个app
 */
object CheackUtils {
    public fun isAppInstalled(uri: String): Boolean {

        val pm: PackageManager = App.getInstance().packageManager;

        var installed = false;

        installed = try {

            pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);

            true;

        } catch (e: PackageManager.NameNotFoundException) {

            false;

        }

        return installed;

    }

}